<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file="../../../common/common-jstl.jspf" %>
<%@ include file="../../../common/common-easyui.jspf" %>
<%@ include file="../../../common/common-layer.jspf" %>
<!DOCTYPE html >
<html>
<head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <style type="text/css">
        .container {
            width: 100%;
            height: 100px;
            background-color: #F5F5F5;
        }

        .content {
            width: 100%;
            height: 80%;

        }

        .content table {
            border-collapse: collapse;
            width: 100%;
        }

        .content table td, .content table th {
            border: 1px solid #ccc;
            padding: 7px;
            text-align: center;
        }

        .title {
            width: 100%;
            height: 32%;
            background-color: #5E5E5E;
        }

        .title > span {
            color: white;
            font-size: 12px;
            font-family: "黑体";
            line-height: 32px;
            text-indent: 1em;
            display: block;
        }

    </style>
</head>
<body>
<div class="container">
    <div class="content">
        <div class="title"><span>导入学生成绩</span></div>
        <form id="fd" action="importController?flag=score" method="post" enctype="multipart/form-data">
            <table>
                <tr>
                    <th>选择导入EXCEL文件:</th>
                    <td><input type="file" name="excelFile"/></td>
                </tr>
                <tr>
                    <td colspan="2"><input type="button" onclick="submitData();" value="  导 入  "/></td>
                </tr>
            </table>
        </form>
    </div>
</div>

<script type="text/javascript">
    function submitData() {
        var form = new FormData(document.getElementById("fd"));
        $.ajax({
            url: "importController?flag=score",
            type: "post",
            data: form,
            processData: false,
            contentType: false,
            success: function (data) {
                if (data == "ok") {
                    layer.msg("导入成功");

                } else if (data == "false") {
                    layer.msg("请上传excel文件");
                }
            },
            error: function (e) {
                layer.msg("导入出现错误！！");

            }
        });
        get();//此处为上传文件的进度条
    }
</script>
</body>
</html>